<?php

if (!function_exists('upload_path')) {
    /**
     * Get the path to the upload folder.
     *
     * @param  string $path
     * @return string
     */
    function upload_path($path = '')
    {
        return app()->basePath() . DIRECTORY_SEPARATOR . "upload" . ($path ? DIRECTORY_SEPARATOR . $path : $path);
    }
}

if (!function_exists('is_base64')) {
    /**
     * 判断字符串是否经过编码方法
     * @param $str
     * @return bool
     */
    function is_base64($str)
    {
        return $str == base64_encode(base64_decode($str)) ? true : false;
    }
}
